import request from "@/utils/request";

export const loginAPI = (data) => {
  return request({ url: '/login/wxMin', method: 'post', data })
};

/**
 * 模拟登录
 */
export const mockLoginAPI = () => {
  return request({
    url: '/login/wxMin/simple', method: 'post', data: {
      phoneNumber: '13577778888'
    }
  })
};

/** 获取个人资料 */
export const getProfileAPI = () => request({ url: "/member/profile" });


export const uploadPhotoAPI = (filePath) => {

  return uni.uploadFile({
    url: '/member/profile/avatar',
    name: 'file',
    filePath,
  })
};


export const updateProfileAPI = (data) => {
  return request({ url: "/member/profile", method: "put", data });
};